require 'watir'
include Watir
require 'test/unit'
require 'test/unit/ui/console/testrunner'
require 'watir/testUnitAddons'
require 'watir/testcase'
require 'watir/contrib/enabled_popup'

class TC_Home < Test::Unit::TestCase
  def test_11_NavigatingToTheEditProfilePageAndSavingData
    $ie.goto($UniVar)
    $ie.refresh()
    

    $ie.link(:text, 'Sign out').click
    $ie.link(:text, 'Join').click
    
    $ie.text_field(:index, 2).set('temp1')
    $ie.text_field(:index, 3).set('temp11')
    $ie.text_field(:index, 4).set('temp11')
    $ie.text_field(:index, 5).set('temp1@telligent.com')
    $ie.text_field(:index, 6).set('temp1@telligent.com')
    
   $ie.button(:id, /ctl00_bcr_ctl01_ctl00_CreateAccount/).click
#  $ie.button(:id, /ctl00_bcr_ctl00___CreateAccount/).click
  
  $ie.goto($UniVar)
  $ie.link(:text, $ADMIN).click
  $ie.text_field(:id, /ctl00_bcr_ctl00___Signature/).value = $ADMIN
  $ie.text_field(:id, /ctl00_bcr_ctl00___bio/).value = "This is my bio :)"
  $ie.div(:text, 'About').click
  $ie.text_field(:id, /ctl00_bcr_ctl00___CommonName/).value = $ADMIN
  $ie.text_field(:id, /ctl00_bcr_ctl00___Location/).value = "Dallas, Texas"
  $ie.text_field(:id, /ctl00_bcr_ctl00___Occupation/).value = "Developer"
  $ie.text_field(:id, /ctl00_bcr_ctl00___Interests/).value = "Developing"
  $ie.text_field(:id, /ctl00_bcr_ctl00___WebAddress/).value = "telligent.com"
  $ie.text_field(:id, /ctl00_bcr_ctl00___WebLog/).value = "telligent.com/blogs"
  $ie.text_field(:id, /ctl00_bcr_ctl00___WebGallery/).value = "telligent.com/photos"
  $ie.div(:text, 'Email').click
  $ie.text_field(:id, /ctl00_bcr_ctl00___PublicEmail/).value = "temp1@telligent.com"
  $ie.text_field(:id, /ctl00_bcr_ctl00___MsnIM/).value = "temp11@telligent.com"
  $ie.text_field(:id, /ctl00_bcr_ctl00___AolIM/).value = "temp111@telligent.com"
  $ie.text_field(:id, /ctl00_bcr_ctl00___YahooIM/).value = "temp1111@telligent.com"
  $ie.text_field(:id, /ctl00_bcr_ctl00___ICQ/).value = "temp11111@telligent.com"
  $ie.text_field(:id, /ctl00_bcr_ctl00___PrivateEmail/).value = "private@telligent.com"
  $ie.button(:value, 'Save Changes').click
  
    $ie.link(:text, 'Sign out').click
    $ie.refresh()
    $ie.link(:text, 'Sign in').click
    $ie.text_field(:id, /username/ ).set($ADMIN)
    $ie.text_field(:id, /password/ ).set($PASSWORD)

    $ie.link(:id, /ctl00_bcr_ctl00_ctl03_loginButton/).click     
#    $ie.link(:id, /ctl00_bcr_Login1___loginButton/).click

    $ie.goto($UniVar + '/ControlPanel/Membership/membersearch.aspx?SelectedNavItem=BrowseMembers')
    $ie.div(:index, 141).click
    $ie.div(:index, 141).click
    $ie.link(:text, 'Actions').click
    $ie.cell(:id, /Menu_3$/).click
    $ie.frame(:index, 6).radio(:index, 2).set
    $ie.frame(:index, 6).button(:caption, 'Delete User').click
  end
end